Health Cloud Diagnostics System API - Implementation Template
Developer guide
Diagnostics Dev Guide
The US-Core Diagnostics application uses the following DataWeave modules to map between Health Cloud and FHIR formats.
Module | Description |
---|---|
DiagnosticReportFHIRTools | DiagnosticReportFHIRTools DataWeave library contains functions used for converting Health Cloud data into FHIR format. |
DiagnosticReportRequest | This module defines functions needed to convert a FHIR DiagnosticReport resource into its representation within Health Cloud. |
ObservationFHIRTools | |
ObservationRequest | This module defines functions needed to convert a FHIR Observation resource into its representation within Health Cloud. |
Util | A library with needed dataweave utility functions. |
DiagnosticReportFHIRTools
DiagnosticReportFHIRTools DataWeave library contains functions
used for converting Health Cloud data into FHIR format.
Source:
.src/main/resources/dwl/DiagnosticReport/DiagnosticReportFHIRTools.dwl
Functions
fun getDiagnosticReportIdentifiers (identifiers, digReport)
Gets the diagnosticReport identifiers with the provided HC ID array and returns a list of FHIR DiagnosticReport objects.
param
idTypeMap
is a map of HC Ids to FHIR identifier codes.
paramidentifiers
is an array of HC identifier objects.
return An array of FHIR Identifier objects.
fun getLinkSelf (attr: Object)
Gets the URL to the current web resource.
param
attr
is an object with the attributes.
return A string with the self link.
fun getEntryUrl (item: Object, attr: Object)
Gets the URL for the entry provided.
param
item
is an object with the item that's being returned.
paramattr
is an object with the attributes.
return A string with the entry URL.
DiagnosticReportRequest
This module defines functions needed to convert a
FHIR DiagnosticReport resource into its representation within
Health Cloud.
Source:
.src/main/resources/dwl/DiagnosticReport/DiagnosticReportRequest.dwl
Functions
fun getDiagnosticReportUpsert (fhirObj, codeSetBundleList, categoryLookup, carePerformerIds)
Converts the provided DiagnosticReport FHIR object to the Health Cloud DiagnosticSummary object.
param
fhirObj
is a FHIR DiagnosticReport object.
paramcodeSetBundleList
is list of Codeset Bundle records.
paramcategoryLookup
is lookup response of FHIR Codesets object.
paramcarePerformerIds
is Salesforce Ids for practitioner references.
return A Health Cloud DiagnosticSummary object.
fun getDiagnosticReportUpdate (fhirObj, codeSetBundleList, categoryLookup, carePerformerIds)
Converts the provided DiagnosticReport FHIR object to the Health Cloud DiagnosticSummary object for Update of Diagnostic Report.
param
fhirObj
is a FHIR DiagnosticReport object.
paramcodeSetBundleList
is a list of Codeset Bundle records.
paramcategoryLookup
is the lookup response of FHIR Codesets object.
paramcarePerformerIds
is Salesforce Ids for practitioner references.
return A Health Cloud DiagnosticSummary object.
fun getDiagnosticReportIdentifier (identifier, diagnosticReportId, typeId)
Converts the provided DiagnosticReport FHIR object to the Health Cloud Identifier object.
param
identifier
is a FHIR DiagnosticReport identifier object.
return A Health Cloud Identifier object.
fun getCodeSetUpsert (codeSetList)
Converts the provided DiagnosticReport FHIR object to the Health Cloud CodeSet object.
param
codeSetList
is the list of codeSet object.
return Health Cloud CodeSet upsert fields.
fun getCodeSetBundleUpsert (codeSetList, bundleType, name)
Converts the provided DiagnosticReport FHIR object to the Health Cloud CodeSetBundle object.
param
codeSetList
is the list of CodeSetBundle object.
parambundleType
is for defining the CodeSetBundle type.
paramname
is for defining the name of the CodeSetBundle.
return Health Cloud CodeSetBundle upsert fields.
ObservationFHIRTools
Source:
.src/main/resources/dwl/Observation/ObservationFHIRTools.dwl
Functions
fun getObservationResponse (observation: Object, codeId, identifiers, searchLookupResponse, unitMeasureCodes)
Generates the observation response object in FHIR format with the provided observation object, identifiers, and code set bundles. Queried from Health Cloud.
param
observation
is a HC Observation object.
paramcodeId
code id associated for the observation
paramidentifiers
a list of identifiers
return of FHIR formatted Observation object.
fun getCategory (categoryDisplay, searchLookupResponse)
Gets the Category if found or null if not.
param
categoryDisplay
is category display value.
paramsearchLookupResponse
is response from FHIR Codeset object.
return a Category as FHIR formatted Method object.
fun getCode (obs, codeId)
Gets the code object with the provided observation object and returns null if not found.
param
obs
is a HC Code object.
paramcodeId
is codeset record.
return An array of FHIR formatted Code objects.
fun getIdentifier (observation, identifiers)
Gets the observation identifiers with the provided HC ID array and returns a list of FHIR Observation objects.
param
observation
is the observation object that has references to codes
paramidentifiers
is an array of HC identifier objects.
return An array of FHIR Identifier objects.
fun getBodySite (obs)
Gets the bodySite object with the provided observation object and returns null if not found.
param
obs
is a HC bodySite object.
return An array of FHIR formatted BodySite objects.
fun getInterpretation (interpretationDisplay, searchLookupResponse)
Gets the Interpretation if found or null if not.
param
interpretationDisplay
is Interpretation display value.
paramsearchLookupResponse
is response from FHIR Codeset object.
return a Interpretation as FHIR formatted Method object.
fun getMethod (obs)
Gets the method object with the provided observation object and returns null if not found.
param
obs
is a HC method object.
return An array of FHIR formatted Method objects.
fun getValueCodeableConcept (obs)
Gets the valueCodeableConcept object if found or null if not.
param
obs
is a HC method object.
return a CodeableConcept as FHIR formatted Method object.
fun getValueRatio (observation, unitMeasureCodes)
Gets the valueRatio object if found or null if not.
param
observation
is a HC method object.
paramunitMeasureCodes
is lookup response of UnitOf​Measure object.
return a Ratio as FHIR formatted Method object.
fun getComponentData (componentCodeSets, components, searchLookupResponse, unitMeasureCodes)
Gets the Component object if found or null if not.
param
componentCodeSets
a list of component codeset HC objects .
paramcomponents
a list of components
return a Component Data as FHIR formatted Method object.
fun getComponentCode (obs)
Gets the Component Code if found or null if not.
param
obs
codeset HC objects .
return a Component Code as FHIR formatted Method object.
fun getComponentInterpretation (componentInterpretation, searchLookupResponse)
Gets the Component Interpretation if found or null if not.
param
componentInterpretation
is componentInterpretation display value.
paramsearchLookupResponse
is response from FHIR Codeset object.
return a Component Interpretation as FHIR formatted Method object.
fun getLinkSelf (attr: Object)
Gets the URL to the current web resource.
param
attr
is an object with the attributes.
return A string with the self link.
fun getEntryUrl (item: Object, attr: Object)
Gets the URL for the entry provided.
param
item
is an object with the item that's being returned.
paramattr
is an object with the attributes.
return A string with the entry URL.
ObservationRequest
This module defines functions needed to convert a
FHIR Observation resource into its representation within
Health Cloud.
Source:
.src/main/resources/dwl/Observation/ObservationRequest.dwl
Functions
fun getObservationDetails (fhirObj, codeSetBundleList, codeId, sourceSystem, lookupResponse, unitMeasureCodes)
Converts the provided Observation FHIR object to the Health Cloud CareObservation object.
param
fhirObj
is a FHIR Observation object.
return A Health Cloud Observation object.
fun getObservationDetailsUpdate (fhirObj, codeSetBundleList, codeId, sourceSystem, lookupResponse, unitMeasureCodes)
Converts the provided Observation FHIR object to the Health Cloud CareObservation object.
param
fhirObj
is a FHIR Observation object.
return A Health Cloud Observation object.
fun getObservationIdentifier (identifier, observationId, typeId)
Converts the provided Observation FHIR object to the Health Cloud Identifier object.
param
identifier
is a FHIR Observation identifier object.
return A Health Cloud Identifier object.
fun getObservationComponents (components, observationId, codeSetBundleList, Index, lookupResponse, unitMeasureCodes)
Converts the provided Observation Component FHIR object to the Health Cloud CareObservationComponent object.
param
components
is a FHIR Observation Component object.
return A Health Cloud Observation object.
fun getCodeSetUpsert (codeSetList)
Converts the provided Observation FHIR object to the Health Cloud CodeSet object.
param
codeSetList
is the list of codeSet object.
return Health Cloud CodeSet upsert fields.
fun getCodeSetBundleUpsert (codeSetList, bundleType, name)
Converts the provided Observation FHIR object to the Health Cloud CodeSetBundle object.
param
codeSetList
is the list of CodeSetBundle object.
parambundleType
is for defining the CodeSetBundle type.
paramname
is for defining the name of the CodeSetBundle.
return Health Cloud CodeSetBundle upsert fields.
fun getResultIds (res)
This function takes the results of a Salesforce query and returns a list of IDs.
param
res
is a Salesforce query result.
return An array with a list of Ids found.
Util
A library with needed dataweave utility functions.
Source:
.src/main/resources/dwl/Util.dwl
Functions
fun clean (obj: Object)
Cleans the provided object of blank strings, null values, empty objects, and empty arrays.
param
obj
is an Object to clean.
return A cleaned object.
fun clean (arr: Array)
Cleans the provided array of blank strings, null values, empty objects, and empty arrays.
param
arr
is an Array to clean.
return A cleaned Array.
fun removeNull (arr: Array)
Removes all null items from an array.
param
arr
is an array.
return An array with null items removed.
fun removeNull (obj: Object)
Removes all null values from an object.
param
obj
is an object.
return An object with null values removed.
fun getPickListValue (req, lookupReq)
Converts the FHIR CodeableConcept fields and result from lookup to get the values for picklist field used in Encounter upsert.
param
req
is a FHIR object field, lookupReq is from FHIRCodeSetc. return_ value for the picklist field.
fun getOrganizationAccount (fhirObj, codeSetLU)
Converts the provided Organization FHIR object to the Health Cloud Account object.
param
fhirObj
is a FHIR Organization object.
return A Health Cloud Account object.